<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Blog</title>
    <link rel="stylesheet" href="../../public/font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="../../public/js/jquery-3.2.1.min.js"></script>
    <script src="../../public/js/index.js"></script>
</head>
<body>
<h1>欢迎光临!!</h1>

<!--导航-->
<nav>
    <div class="menu">
        {% if category == '' %}
        <a href="/" class="focus">首页</a>
        {% else %}
        <a href="/">首页</a>
        {% endif %}

        {% for cate in categories %}
        {% if category == category.id %}
        <a href="/?category={{category.id}}" class="focus">{{cate.name}}</a>
        {% else %}
        <a href="/?category={{category.id}}">{{cate.name}}</a>
        {% endif %}
        {% endfor%}
    </div>
</nav>

<!--内容-->
<main class="clear">

    <div class="mainLeft">
        {% block content %}
        {% endblock %}
    </div>

    <!--登录注册-->
    <div class="mainRight">
        {% if userInfo._id %}
        <div class="rigntBox" id="userInfo">
            <div class="title"><span>用户信息</span></div>
            <p><span class="colDark username">{{userInfo.username}}</span></p>
            <p><span class="colDanger info">你好，{{userInfo.username}}</span>
                {% if userInfo.isAdmin %}
                <a href="/admin">进入管理</a>
                {% else %}
                {% endif %}
            </p>
            <p><span class="colDark logout" id="logout"><a href="javascript:;">退出</a></span></p>
        </div>
        {% else %}
        <div class="rightBox" id="loginBox">
            <div class="title"><span>登录</span></div>
            <div class="line"><span class="colDark">用户名：</span><input name="username" type="text"><em></em></div>
            <div class="line"><span class="colDark">密码：</span><input name="password" type="password"><em></em></div>
            <div class="line"><span class="colDark"></span><button>登录</button></div>
            <p class="textRight">还没注册？<a href="javascript:;" class="colMint">马上注册</a></p>
            <p class="colWarning textCenter"></p>
        </div>
        {% endif %}

        <div class="rightBox" id="registerBox" style="display: none;">
            <div class="title"><span>注册</span></div>
            <div class="line"><span class="colDark">用户名：</span><input name="username" type="text"></div>
            <div class="line"><span class="colDark">密码：</span><input name="password" type="password"></div>
            <div class="line"><span class="colDark">确认密码：</span><input name="repassword" type="password"></div>
            <div class="line"><span class="colDark"></span><button>注册</button></div>
            <p class="textRight">已有账号？<a href="javascript:;" class="colMint">马上登录</a></p>
            <p class="colWarning textCenter"></p>
        </div>
    </div>
</main>

<footer></footer>
</body>
</html>